<?php


use Illuminate\Support\Facades\Route;

Route::namespace('admin')->group(function (){
    //需要登录并且进行鉴权
    Route::prefix('admin')->middleware('checkAdminLoginAndCheAuth')->group(function (){
        Route::any('/','HomeController@index')->name('admin.main');
        Route::any('/home','HomeController@home')->name('admin.home');


        Route::get('/get_xiangmus','ProjectController@projects')->name('admin.xiangmu.lists');
        Route::any('/add_xiangmu','ProjectController@add_project')->name('admin.xiangmu.add_project');
        Route::any('/set_skus','ProjectController@set_skus')->name('admin.xiangmu.set_skus');
        Route::any('/edit_xiangmus','ProjectController@edit_project')->name('admin.xiangmu.edit_project');
        Route::any('/del_project','ProjectController@del_project')->name('admin.projects.del_project');


        Route::get('/get_category','CategoryController@lists')->name('admin.category.lists');
        Route::any('/add_category','CategoryController@add')->name('admin.category.add');
        Route::any('/update_category','CategoryController@update')->name('admin.category.update');
        Route::any('/delete_images','ImagesController@delete_images')->name('admin.images.delete_images');
        Route::get('/users','UsersController@users')->name('admin.users.user');
        Route::any('/set_shop_user','UsersController@set_shop_user')->name('admin.users.set_shop_user');
        Route::any('/user_edits','UsersController@user_edit')->name('admin.users.user_edit');
        Route::any('/set_hehuo','UsersController@set_hehuo')->name('admin.users.set_hehuo');




        Route::get('/get_shops','ShopsController@lists')->name('admin.shops.lists');
        Route::get('/get_hexiaos','ShopsController@hexiaos')->name('admin.shops.hexiaos');
        Route::get('/get_kucun','ShopsController@kucun')->name('admin.shops.kucun');
        Route::get('/get_images','ImagesController@index')->name('admin.setting.images');
        Route::any('/add_images','ImagesController@add')->name('admin.images.add');
        Route::any('/edit_images','ImagesController@edit')->name('admin.images.edit');


        Route::any('/get_orders','OrdersController@orders')->name('admin.orders.orders');
        Route::any('/send_huo','OrdersController@send_huo')->name('admin.orders.send_huo');

        Route::get('/lists_tixian','BillController@lists_tixian')->name('admin.bills.bills_ttixian');
        Route::any('/audit_bill','BillController@audit')->name('admin.bill.audit');


        Route::any('/settings','SettingsController@settings')->name('admin.settings.settings');
        Route::any('/fanxian','SettingsController@fanxian')->name('admin.settings.fanxian');
        Route::any('/chongzhi','UsersController@chongzhi')->name('admin.users.chongzhi');
    });




    //不需要登录的后台接口
    Route::prefix('admin')->group(function (){
        Route::any('login','LoginController@login')->name('admin.login');//后台用户登录
        Route::any('file_up','HomeController@file_up')->name('admin.file_up');
        Route::any('file_up1','HomeController@local1')->name('admin.local1');
        Route::any('file_up2','HomeController@file_up2')->name('admin.local2');
        Route::any('get_area','UsersController@get_area')->name('admin.get_area');
    });
});
